<!--  -->
<template>
  <div>
    <div class="type_dialog">
      <el-dialog :visible.sync="dialogVisible" width="500px" height="210px">
        <template slot="title">
          <div class="tishi">
            <span> {{ title }}</span>
          </div>
        </template>
        <div>
          <el-input
            type="text"
            placeholder="请输入视频回调地址 http 或 https 开头"
            v-model="typetext"
            :disabled="disabled"
          >
          </el-input>
          <slot></slot>
        </div>
        <div slot="footer" class="dialog-footer">
          <button v-if="disabled" class="btn_add" @click="disabled = false">编 辑</button>
          <button class="btn_add" @click="showCallback" v-else-if="!disabled">
            确 定
          </button>
          <button @click="dialogVisible = false" class="can_btn">取 消</button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      typetext: '',
      dialogVisible: false,
      title: '',
      disabled: true
    }
  },
  props: {},
  created() {},
  methods: {
    showdialog(title, name) {
      this.title = ''
      this.dialogVisible = true
      this.disabled = true
      this.title = title
      this.typetext = name
    },
    showdialog2() {
      this.dialogVisible = false
    },
    showCallback() {
      this.dialogVisible = false
      this.$emit('showCallback', this.typetext)
    }
  }
}
</script>

<style scoped lang="scss">
@import './style.scss';
</style>
<style lang="scss">
.type_dialog {
  .el-dialog__header {
    border-bottom: 1px solid #f5f5f5;
  }
  .el-dialog__footer {
    text-align: center;
  }
}
</style>
